#ifndef CARDINFO_H
#define CARDINFO_H

#include "includes.h"



class CardInfo : public QObject {
	Q_OBJECT
public:
	
	/* Function of the card: Distance, hazard, remedy or safety */
	enum FunctionType {
		Function_NoFunction, // NoCard
		Function_Distance,
		Function_Hazard,
		Function_Remedy,
		Function_Safety
	};
	typedef FunctionType CardFunction;
	
	
	
	/* Nature of the card, for compatibility between a hazard and its remedy/safety */
	enum NatureTypeEnum {
		Nature_NoNature = 0, // Distance cards / NoCard
		Nature_Accident = 1,
		Nature_Gas = 2,
		Nature_Tire = 4,
		Nature_Speed = 8,
		Nature_Light = 16
	};
	
	// Declares the enum as a QFlags (typedef QFlags<NatureTypeEnum> NatureType;)
	Q_DECLARE_FLAGS(NatureType, NatureTypeEnum)
	
	typedef NatureType CardNature;
	
	
	
	
public:
	
	explicit CardInfo(QString name, QString filename, CardFunction function, CardNature nature, int distance);
	
	QString getName() const;
	QString getFilename() const;
	CardFunction getFunction() const;
	CardNature getNature() const;
	int getDistance() const;


private:
	QString name;
	QString filename;
	CardFunction function;
	CardNature nature;
	int distance;
};


// Declares operator|() for CardNature enum-flag
Q_DECLARE_OPERATORS_FOR_FLAGS(CardInfo::NatureType)


typedef CardInfo::FunctionType CardFunction;
typedef CardInfo::NatureType CardNature;





#endif // CARDINFO_H
